﻿using System;
using System.IO;
using System.Text.RegularExpressions;

namespace AutoExecuteSp
{
    #region Nested type: ExecuteResult

    [Serializable]
    public class ExecuteResult
    {
        private readonly Regex regex = new Regex(@"Msg \d+, Level \d+, State \d+",
                                                 RegexOptions.IgnoreCase | RegexOptions.Compiled);

        public string Message { get; set; }

        public Exception Exception { get; set; }

        public bool IsSuccess
        {
            get { return !regex.IsMatch(Message) && Exception == null; }
        }

        public FileInfo FileInfo { get; set; }
    }

    #endregion
}